<template>
  <Modal
    v-model:active="reNumberActiveModal"
    transfer
    title="重新编号"
    :width="480"
    confirm-text="重新编号"
    @confirm="reNumber"
  >
    <ConfigProvider :props="providedProps">
      <Form :model="formModel" style="padding: 24px">
        <Column :span="21" :offset="3">
          <FormItem label="初始值：" prop="startId">
            <NumberInput
              v-model:value="formModel.startId"
              control-type="right-fade"
              placeholder="请输入初始值"
            ></NumberInput>
          </FormItem>
        </Column>
        <Column :span="21" :offset="3">
          <FormItem label="增量：" prop="type">
            <NumberInput
              v-model:value="formModel.increment"
              control-type="right-fade"
              placeholder="请输入增量值"
            ></NumberInput>
          </FormItem>
        </Column>
        <Column :span="21" :offset="3">
          <FormItem label="偏移：" prop="offset">
            <NumberInput
              v-model:value="formModel.offset"
              control-type="right-fade"
              placeholder="请输入偏移值"
            ></NumberInput>
          </FormItem>
        </Column>
      </Form>
    </ConfigProvider>
  </Modal>
</template>
<script setup lang="ts">
import { ref, reactive } from "vue";
import {
  Modal,
  Select,
  Divider,
  Form,
  FormItem,
  ConfigProvider,
  Checkbox,
  Row,
  Column,
  Input,
  RadioGroup,
  Radio,
  Upload,
  Button,
  NumberInput,
} from "cax-ui";
import { storeToRefs } from "pinia";
import { useCoreStore, _global } from "@/UI/store";
const coreStore = useCoreStore();
let { reNumberActiveModal } = storeToRefs(coreStore);

const providedProps = {
  default: { clearable: true },
  formItem: { required: false },
};
const formModel = reactive({
  startId: 100,
  increment: 1,
  offset: 1,
});
function reNumber() {
  _global.Engine.meshComp.renumberingCellIds(formModel);
}
</script>

<style scoped lang="less">
.title {
  display: flex;
  align-items: center;
  margin-bottom: 16px;

  .title_color {
    width: 4px;
    height: 12px;
    background: #339af0;
    margin-right: 8px;
  }
  .title_content {
    opacity: 1;
    font-family: PingFang SC;
    font-size: 14px;
    font-weight: 600;
    line-height: 22px;
    letter-spacing: 0em;
    font-variation-settings: "opsz" auto;
    /* content/主要一级primary */
    /* 样式描述：--vxp-content-color-primary */
    color: #212529;
  }
}
</style>
